<script setup>
import {defineEmits} from 'vue'

const emit = defineEmits(['son-click'])

const handleClick = () => {
  emit('son-click', '我是子组件传给父组件的值')
}
</script>

<template>
  <div class="son1">
    <button @click="handleClick">子组件向父组件传值</button>
  </div>
</template>

<style scoped>
.son1 {
  width: 400px;
  height: 200px;
  background-color: hotpink;
}
</style>
